<?php

namespace App\Http\Controllers\Dynamic;

use App\LogicService\Contracts\BloodEventLogicContract;
use App\Models\Dynamic\BloodDiet;
use App\User;
use Illuminate\Http\Request;
use App\Http\Controllers\ApiController;

class BloodEventController extends ApiController
{

    /**
     * @var \App\Models\Dynamic\BloodDiet
     */

    protected $user;

    protected $bloodDiet;

    protected $request;

    protected $bloodEvent;
    /**
     * SamReferGlucoseController constructor.
     * @param BloodDiet $bloodDiet
     * @param Request $request
     */
    public function __construct(User $user, BloodDiet $bloodDiet,
                                Request $request,BloodEventLogicContract $bloodEvent)
    {

        parent::__construct();
        $this->user = $user;
        $this->bloodDiet = $bloodDiet;
        $this->request = $request;
        $this->bloodEvent = $bloodEvent;
    }

    /**
     *
     */
    public function getListByUid()
    {

        $this->validate($this->request,[

            'user_id' => 'required|integer',
        ]);

        $user_id = $this->request->input('user_id');

        $data = $this->bloodEvent->getEventList($user_id);

        return $this->response($data);
    }
}
